import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
//引入国际化插件
import { createI18n } from 'vue-i18n';
import en from './language/en';
import zh from './language/zh';
//引入markdown插件
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
import hljs from 'highlight.js';

import App from './App.vue'
import router from './router'

// 组合语言包对象
const messages = {
    en,
    zh
}

// 创建实例对象
const i18n = createI18n({
  legacy: false,  // 设置为 false，启用 composition API 模式
  messages,
  locale: sessionStorage.getItem('locale') || 'zh' // 读取存储的语言偏好
  
})

VMdEditor.use(githubTheme, {
  Hljs: hljs,
});


const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(i18n);
app.use(VMdEditor);

app.mount('#app')


